<template>
  <div class="gooslist">
    
    <ul>
      <li v-for="item in goodsList" :key="item.id" @click="gotodetail(item.id)">
        <img :src="item.list_pic_url" alt="" />
        <p>{{ item.name }}</p>
        <p class="p1">{{ item.retail_price | formatMoney }}</p>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  name: "",
  props: ["goodsList"],
  data() {
    return {};
  },
  computed: {},
  components: {},
  methods: {
    gotodetail(item) {
      console.log(item);
      this.$router.push({ path: "/productDetail", query:{id:item} });
    },
  },
  created() {},
};
</script>
<style lang="less" scoped>
.gooslist {
  padding-bottom: 10px;
  ul {
    // width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0 10px;
    li {
      width: 46%;
      height: 210px;
      img {
        width: 100%;
      }
      p {
        height: 18px;
        line-height: 18px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        text-align: center;
        font-size: 16px;
      }
      .p1 {
        color: #8b0000;
      }
    }
  }
}
</style>
